/*###################################################################*
#
# MP (Mitchell Pell) Base - CrossPlatform Base Utilities.
# Copyright (C) 2014  Mitchell Pell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
####################################################################*/
#ifndef BASE_COMMAND_TEMPLATE_H
#define BASE_COMMAND_TEMPLATE_H

#include <string>
#include <boost/shared_ptr.hpp>

using std::string;

namespace mp_base{
	namespace console{

		/*!----------------------------------------------------------------
		*	@class		CommandTemplate
		*	@brief		
		*
		*	@author		Mitchell Pell
		*	@date		11/23/2013
		*	@version	1.0
		*
		*	@revisions	Revision History:
		*
		*					- Version 1.0 11/23/2013
		*						-# Initial Make
		*
		------------------------------------------------------------
		{-----*/
		class CommandTemplate
		{
		public:
			CommandTemplate():
				m_command(""), m_arguments(""){}
			CommandTemplate(const string command, const string args)
				 {ProcessCommand(*this, command, args);}

			const string GetCommand() const { return m_command; }
			const string GetArguments() const { return m_arguments; }
			void SetCommand(const string command) 
				{ m_command = command; }
			void SetArguments(const string arguments) 
				{ m_arguments = arguments; }

		protected:

			static void ProcessCommand(CommandTemplate& cmd, 
				const string command, const string arguments)
			{
				if (command.length() <= 0)
					throw CMD_TEMPLATE_ERROR;
			}

			string m_command;
			string m_arguments;

		public:
			static const string CMD_TEMPLATE_ERROR;
		};
		typedef boost::shared_ptr<CommandTemplate> spCommandTemplate;
	}
}

#endif